//app.js
App({
  onLaunch: function (options) {
    // 展示本地存储能力
    let user_id = options.user_id == undefined ? 0 : options.user_id
    if (options.query.scene) {
      let scene = decodeURIComponent(options.query.scene);
      console.log(options.query)
      //&是我们定义的参数链接方式
      user_id = scene.split("&")[0];
      this.globalData.workshop_id = scene.split('&')[1];
    }
    console.log(user_id)
    //推荐个人
    wx.request({
      url: this.globalData.apiurl + "agent/" + user_id,
      /*  header: {
          "Authorization": "bearer " + app.globalData.access_token
        },*/
      method: 'get',
      success: res => {
        if (res.data.code == 0) {
          this.globalData.userInfo= res.data.data
    
          if (this.emptyUserInfoCallback) {
            this.emptyUserInfoCallback(this.globalData.userInfo);
          }
        }
      }})

  },
  globalData: {
    userInfo: null,
    apiurl:'https://api.sunhouse2002.com/agentApi/',
    workshop_id:null,
  }
})